package com.example.yunJie.digitalSentry.mapper.one;


import com.example.yunJie.digitalSentry.entity.ShiftPeriodEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;
import java.util.List;

public interface ShiftPeriodMapper {
//    @Insert("<script> insert into sz_shift_period(periodId,shiftId)\n" +
//            "        values(#{periodId},#{shiftId})</script>")
    int insert(ShiftPeriodEntity shiftPeriodEntity);

//    @Update("<script>update sz_shift_period\n" +
//            "        <trim prefix=\"SET\" suffixOverrides=\",\">\n" +
//            "            <if test=\"periodId != null\">periodId = #{periodId},</if>\n" +
//            "            <if test=\"shiftId != null\">shiftId = #{shiftId},</if>\n" +
//            "        </trim>\n" +
//            "        where id = #{id}</script>")
    int update(ShiftPeriodEntity shiftPeriodEntity);

//    @Delete("<script>delete from sz_shift_period where id = #{Id}</script>")
    int deleteById(Serializable id);
//    @Delete("<script> delete from sz_shift_period where shiftId = #{shiftId}</script>")
    int deleteByShiftId(String shiftId);
//    @Delete("<script>delete from sz_shift_period where id in\n" +
//            "        <foreach collection=\"array\" item=\"id\" open=\"(\" separator=\",\" close=\")\">\n" +
//            "            #{id}\n" +
//            "        </foreach></script>")
    int deleteIdList(List<Integer> idList);
//    @Select("<script>select * from sz_shift_period\n" +
//            "        <where>\n" +
//            "            <if test=\"shiftId != null and shiftId != ''\">and shiftId = #{shiftId} </if>\n" +
//            "        </where></script>")
    ShiftPeriodEntity findByShiftId(String shiftId);
//    @Select("<script>select  *\n" +
//            "        from sz_shift_period\n" +
//            "        where id = #{id}</script>")
    ShiftPeriodEntity findId(Serializable id);
//    @Select("<script>select * from sz_shift_period\n" +
//            "        <where>\n" +
//            "            <if test=\"shiftId != null and shiftId != ''\">and shiftId = #{shiftId} </if>\n" +
//            "            <if test=\"periodId != null and periodId != ''\">and periodId = #{periodId} </if>\n" +
//            "        </where></script>")
    ShiftPeriodEntity find(ShiftPeriodEntity shiftPeriodEntity);

//    @Select("<script>select * from sz_shift_period</script>")
    List<ShiftPeriodEntity> findAll(ShiftPeriodEntity shiftPeriodEntity);
}
